package com.example.hans.databaseandroid;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;

/**
 * 远程源:git@gitee.com:XMHans/DatabaseAndroid.git
 */
public class MainActivity extends AppCompatActivity implements View.OnClickListener{


    private Button mBtnToLogIn;
    private Button mBtuToCreateAccount;

    public void initView() {
        mBtnToLogIn = findViewById(R.id.btn_toLogIn);
        mBtuToCreateAccount = findViewById((R.id.btn_toCreateAccount));

        mBtnToLogIn.setOnClickListener(this);
        mBtuToCreateAccount.setOnClickListener(this);

    }



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initView();
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_toLogIn: {
                Intent intent = new Intent(this,LoginActivity.class);
                startActivity(intent);
                break;
            }
            case R.id.btn_toCreateAccount: {
                Intent intent = new Intent(this,CreateAccountActivity.class);
                startActivity(intent);
                break;
            }
            default:
        }
    }
}
